<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/examples/analogueModels/SimpleMacLayer.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00236.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">SimpleMacLayer.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef SIMPLEMACLAYER_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define SIMPLEMACLAYER_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;omnetpp.h&gt;</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;Signal_.h&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;BaseModule.h&quot;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="keyword">class </span>MacPkt;
<a name="l00010"></a>00010 <span class="keyword">class </span><a class="code" href="a00134.html" title="Defines the methods provided by the phy to the mac layer.">MacToPhyInterface</a>;
<a name="l00011"></a>00011 
<a name="l00022"></a><a class="code" href="a00196.html">00022</a> <span class="keyword">class </span><a class="code" href="a00196.html" title="A simple Mac layer implementation which only shows how to create Signals, send them to Phy and receiv...">SimpleMacLayer</a>:<span class="keyword">public</span> <a class="code" href="a00027.html" title="Base class for all simple modules of a host.">BaseModule</a> {
<a name="l00023"></a>00023 <span class="keyword">public</span>:
<a name="l00024"></a>00024   <span class="keyword">typedef</span> MacPkt* macpkt_ptr_t;
<a name="l00025"></a>00025 <span class="keyword">private</span>:
<a name="l00028"></a>00028   <a class="code" href="a00196.html" title="A simple Mac layer implementation which only shows how to create Signals, send them to Phy and receiv...">SimpleMacLayer</a>(<span class="keyword">const</span> <a class="code" href="a00196.html" title="A simple Mac layer implementation which only shows how to create Signals, send them to Phy and receiv...">SimpleMacLayer</a>&amp;);
<a name="l00031"></a>00031   <a class="code" href="a00196.html" title="A simple Mac layer implementation which only shows how to create Signals, send them to Phy and receiv...">SimpleMacLayer</a>&amp; <a class="code" href="a00196.html#ab94865cc9947b44466914291b37a2eac" title="Assignment operator is not allowed.">operator=</a>(<span class="keyword">const</span> <a class="code" href="a00196.html" title="A simple Mac layer implementation which only shows how to create Signals, send them to Phy and receiv...">SimpleMacLayer</a>&amp;);
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">protected</span>:
<a name="l00035"></a><a class="code" href="a00196.html#ad7ed88006647e680895f4737464fc639">00035</a>   <a class="code" href="a00134.html" title="Defines the methods provided by the phy to the mac layer.">MacToPhyInterface</a>* <a class="code" href="a00196.html#ad7ed88006647e680895f4737464fc639" title="Pointer to the phy module of this host.">phy</a>;
<a name="l00036"></a>00036 
<a name="l00038"></a><a class="code" href="a00196.html#a6bef5234e57995505bed24b48e68f77a">00038</a>   <span class="keywordtype">int</span> <a class="code" href="a00196.html#a6bef5234e57995505bed24b48e68f77a" title="Omnet gates.">dataOut</a>;
<a name="l00039"></a>00039   <span class="keywordtype">int</span> dataIn;
<a name="l00040"></a>00040 
<a name="l00041"></a>00041   <span class="keywordtype">long</span> myIndex;
<a name="l00042"></a>00042 
<a name="l00044"></a><a class="code" href="a00196.html#a67addba2fe8f0c3cccb46662b8d97038">00044</a>   <span class="keywordtype">long</span> <a class="code" href="a00196.html#a67addba2fe8f0c3cccb46662b8d97038" title="The index of the host the next packet should be send to.">nextReceiver</a>;
<a name="l00045"></a>00045 
<a name="l00046"></a>00046   <span class="keyword">enum</span> {
<a name="l00048"></a><a class="code" href="a00196.html#abfa6d561f6a78e4067a27434d766225fa4b9a5853e8ca522bc3f0be62c042d894">00048</a>     <a class="code" href="a00196.html#abfa6d561f6a78e4067a27434d766225fa4b9a5853e8ca522bc3f0be62c042d894" title="Used as Message kind to identify MacPackets.">TEST_MACPKT</a> = 12121
<a name="l00049"></a>00049   };
<a name="l00050"></a>00050 
<a name="l00052"></a><a class="code" href="a00196.html#a22ca1a18e1bed2f5875c1cca654a9a88">00052</a>   <a class="code" href="a00086.html" title="Represents a set of dimensions which is used to define over which dimensions a mapping is defined (th...">DimensionSet</a> <a class="code" href="a00196.html#a22ca1a18e1bed2f5875c1cca654a9a88" title="The dimensions for the signal this mac layer works with (frequency and time)">dimensions</a>;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 <span class="keyword">protected</span>:
<a name="l00055"></a>00055 
<a name="l00060"></a>00060   <a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* <a class="code" href="a00196.html#a376421d6d86692c47dacaaebfd21ebd7" title="Creates a Mapping with the passed value at the passed position in freqency and time.">createMapping</a>(simtime_t_cref time, simtime_t_cref length, <span class="keywordtype">double</span> freqFrom, <span class="keywordtype">double</span> freqTo, <span class="keywordtype">double</span> value);
<a name="l00061"></a>00061 
<a name="l00062"></a>00062   <span class="keywordtype">void</span> handleMacPkt(macpkt_ptr_t pkt);
<a name="l00063"></a>00063   <span class="keywordtype">void</span> handleTXOver();
<a name="l00064"></a>00064 
<a name="l00068"></a>00068   <span class="keywordtype">void</span> <a class="code" href="a00196.html#a24a84df3fe2796c6ef724227dd6293bd" title="Sends the answer packet.">broadCastPacket</a>();
<a name="l00069"></a>00069 
<a name="l00070"></a>00070   <span class="keywordtype">void</span> sendDown(macpkt_ptr_t pkt);
<a name="l00071"></a>00071 
<a name="l00075"></a>00075   macpkt_ptr_t <a class="code" href="a00196.html#aa39c30004cbd08a2a0b0405d818313b0" title="Creates the answer packet.">createMacPkt</a>(simtime_t_cref length);
<a name="l00076"></a>00076 
<a name="l00077"></a>00077   <span class="keywordtype">void</span> log(std::string msg);
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="keyword">public</span>:
<a name="l00080"></a>00080   <a class="code" href="a00196.html" title="A simple Mac layer implementation which only shows how to create Signals, send them to Phy and receiv...">SimpleMacLayer</a>()
<a name="l00081"></a>00081     : <a class="code" href="a00027.html" title="Base class for all simple modules of a host.">BaseModule</a>()
<a name="l00082"></a>00082     , <a class="code" href="a00196.html#ad7ed88006647e680895f4737464fc639" title="Pointer to the phy module of this host.">phy</a>(NULL)
<a name="l00083"></a>00083     , <a class="code" href="a00196.html#a6bef5234e57995505bed24b48e68f77a" title="Omnet gates.">dataOut</a>(-1)
<a name="l00084"></a>00084     , dataIn(-1)
<a name="l00085"></a>00085     , myIndex(-1)
<a name="l00086"></a>00086     , <a class="code" href="a00196.html#a67addba2fe8f0c3cccb46662b8d97038" title="The index of the host the next packet should be send to.">nextReceiver</a>(-1)
<a name="l00087"></a>00087     , <a class="code" href="a00196.html#a22ca1a18e1bed2f5875c1cca654a9a88" title="The dimensions for the signal this mac layer works with (frequency and time)">dimensions</a>()
<a name="l00088"></a>00088   {}
<a name="l00089"></a>00089 
<a name="l00090"></a>00090   <span class="comment">//---Omnetpp parts-------------------------------</span>
<a name="l00091"></a>00091   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00196.html#a9a23cdc88daa658398f0bc10ac4ed219" title="Basic initialization for all modules.">initialize</a>(<span class="keywordtype">int</span> stage);
<a name="l00092"></a>00092 
<a name="l00093"></a>00093   <span class="keyword">virtual</span> <span class="keywordtype">void</span> handleMessage(cMessage* msg);
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 <span class="preprocessor">#endif </span><span class="comment">/*TESTMACLAYER_H_*/</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>SimpleMacLayer.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:29 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
